package com.study.web.controller.operate;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.study.app.domain.bo.FaqBo;
import com.study.app.domain.vo.FaqVo;
import com.study.app.service.IFaqService;
import com.study.app.domain.vo.AppUserVo;
import com.study.app.service.IAppUserService;
import com.study.common.core.controller.AppBaseController;
import com.study.common.core.domain.PageQuery;
import com.study.common.core.domain.R;
import com.study.common.core.page.TableDataInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * App  FAQ详情 --
 */

@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/faq")
public class AppUserFaqController extends AppBaseController {

    private final IFaqService iFaqService;

    private final IAppUserService iAppUserService;

    /**
     * 查询FAO Info列表
     */
    @SaCheckLogin
    @GetMapping("/list")
    public R<TableDataInfo<FaqVo>> list(PageQuery pageQuery) {
        AppUserVo userVo = iAppUserService.queryById(getUserId());
        FaqBo bo = new FaqBo();
        bo.setLangType(userVo.getLanguageIden());
        return R.ok(iFaqService.queryPageList(bo, pageQuery));
    }
}
